import { NoFrame } from '../../components/no-frame'
import { useState } from 'react'
import { Status } from './type'
import { WaitConfirm } from './components/wait-confirm'
// import { Progress } from './components/progress'

export function Update(): JSX.Element {
  const [status] = useState(Status.waitConfirm)

  const onCommonCancel = (): void => {
    // window.close()
  }

  const onWaitConfirm = (): void => {
    window.main.quitAndInstall()
  }

  return (
    <NoFrame>
      {status === Status.waitConfirm && (
        <WaitConfirm onCancel={onCommonCancel} onConfirm={onWaitConfirm} />
      )}
    </NoFrame>
  )
}
